Page({
  data: {
    latitude: 23.099994,
    longitude: 113.324520,
    markers: [{
	  id:1,
      latitude: 23.099994,
      longitude: 113.324520,
    }]
  },
  onLoad(options){
	  var that = this
	  console.log(options)
	  wx.getLocation({
	  	type: 'wgs84',
	  	success: function(res) {
			 wx.openLocation({
				name:options.c,
			   latitude:parseFloat(options.a),
			   longitude: parseFloat(options.b),
			   address:options.d
			 })
			var markers = that.data.markers
			markers[0].latitude=options.a
			markers[0].longitude=options.b
			var a = res.latitude
			var b = res.longitude
			that.setData({
				latitude:a,
				longitude:b,
				markers:markers
			})
		},
	})
  },
  onReady: function (e) {
    this.mapCtx = wx.createMapContext('myMap')
  },

})
